package com.pace.netty.myRPC.client;

import com.pace.netty.service.OrderService;

/**
 * Package: com.pace.netty.echo.client
 * Description： TODO
 * Author: Forest
 * Date: Created in 2021/4/6 0:28
 * Version: 0.0.1
 * Modified By: duforest
 */
public class ClientBootstrap {

    //这里定义协议头
    public static final String providerName = "HelloService#hello#";

    public static void main(String[] args) throws Exception {

        //创建一个消费者
        NettyClient customer = new NettyClient();

        //创建代理对象
        OrderService service = (OrderService) customer.getBean(OrderService.class, providerName);

        for (; ; ) {
            Thread.sleep(2 * 1000);
            //通过代理对象调用服务提供者的方法(服务)
            String res = service.hello("你好 dubbo~");
            System.out.println("调用的结果 res= " + res);
        }
    }
}